Program to count digits in an integer